/**
 * 
 */
package fr.cephb.operonj.core.db.binding;

import com.sleepycat.bind.tuple.TupleBinding;
import com.sleepycat.bind.tuple.TupleInput;
import com.sleepycat.bind.tuple.TupleOutput;

import fr.cephb.operonj.core.db.key.SequenceIndex;

/**
 * @author pierre
 *
 */
public class SequenceIndexBinding
	extends TupleBinding<SequenceIndex>
	{
	@Override
	public SequenceIndex entryToObject(TupleInput input)
		{
		return new SequenceIndex(
			input.readInt(),
			input.readInt(),
			input.readInt()
			);
		}

	@Override
	public void objectToEntry(SequenceIndex seq, TupleOutput output)
		{
		output.writeInt(seq.getBuildId());
		output.writeInt(seq.getChromId());
		output.writeInt(seq.getIndex());
		}
	}
